package com.auxgroup.smarthome.inner.controller;

import com.auxgroup.bridge.app.inner.vo.PushRecordVo;
import com.auxgroup.smarthome.inner.service.PushRecordService;
import com.auxgroup.smarthome.web.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by lixiaoxiao on 17-10-16.
 */
@Api(description = "推送记录", tags = "推送记录")
@RestController
@RequestMapping("/pushRecord")
public class PushRecordController {

    @Autowired
    private PushRecordService pushRecordService;

    @ApiOperation(value = "获取推送记录",notes = "获取推送记录")
    @RequestMapping(value = "/list/{uid}", method = RequestMethod.GET)
    public ApiResponse<List<PushRecordVo>> findAllByUid(@PathVariable("uid") String uid, @RequestParam("time") String time){
        return ApiResponse.ok(pushRecordService.findAllByUid(uid,time));
    }

}
